# 装饰模板
def outer(func):
    def inner(*args, **kwargs):
        print('函数执行前添加的功能')
        res = func(*args, **kwargs)
        print('函数执行后添加的功能')
        return res

    return inner


def index():
    print('from index')


index = outer(index)
index()
